<%@ page import="java.util.*,com.db.tracker.util.*,com.db.tracker.vo.*,java.text.*,java.io.*" %>
<%

try {
	 session = request.getSession();

	 if (session.getAttribute("USER_ID") == null || !((String) session.getAttribute("SESSION_ID")).equals(session.getId())) {

		 try {
				response.sendRedirect("LoginPage.jsp");
		 }catch (IOException ioe) {
					ioe.printStackTrace();
		 }
	
	 } 
	 else
	 {
			
		DBUtil dbutil = new DBUtil(getServletContext());
		String userid = (String)session.getAttribute("USER_ID")==null?"":(String)session.getAttribute("USER_ID");
		userid = userid.toLowerCase();

%>
<html>
	<head>
	<link type="text/css" rel="stylesheet" href="styles/tracker_style.css">
	<title>Add Release Unix Script Detail</title>
	<script>
		  function trim(sString)
		  {
			sTrimmedString = "";
		   if (sString != "") {
			  var iStart = 0;
			  var iEnd = sString.length - 1;
			 // var sWhitespace = " \t\f\n\r\v";
			 var sWhitespace = "   ";


			  while (sWhitespace.indexOf(sString.charAt(iStart)) != -1) {
				 iStart++;
				 if (iStart > iEnd) 
					break;
			  }

			  // If the string not just whitespace
			  if (iStart <= iEnd) {
				 while (sWhitespace.indexOf(sString.charAt(iEnd)) != -1)
					iEnd--;
				 sTrimmedString = sString.substring(iStart,++iEnd);
			  }
		   }
		   return sTrimmedString;
		 }



	 	function showFiles(o)
		{
		var opassitem = document.getElementById(o);
		//alert(event.srcElement.value);
		//var imgname = "img" + o;
		//var imgAct = document.all(imgname);
		if (opassitem.style.visibility == "hidden")
		{
			opassitem.style.visibility = "visible";
			//imgAct.src = "images/plus.gif";
		}
	/*	else
		{
			opassitem.style.visibility = "hidden";
			//imgAct.src = "images/minus.gif";
		}*/
		}
	function hideFiles(o){
		var opassitem = document.getElementById(o);
		if (opassitem.style.visibility == "visible")
		{
			opassitem.style.visibility = "hidden";
			//imgAct.src = "images/minus.gif";
		}
	}
		
	function unHider()
	{
	
		if(document.addRelease.objectType.value =="ALTER" || document.addRelease.objectType.value =="ENDSQL" ||
			document.addRelease.objectType.value =="INITSQL")
		{
			
			
			document.all.div1.style.display = 'block';
			
			document.all.div2.style.display = 'block';
			
		}
		else
		{
			
			document.all.div1.style.display = 'none';
			document.all.div2.style.display = 'none';
			
		}

		document.addRelease.submit();
	}

		function addRow()
		{		
			document.addUnixScriptForm.shellName.value =trim(document.addUnixScriptForm.shellName.value);
			document.addUnixScriptForm.repoLocation.value =trim(document.addUnixScriptForm.repoLocation.value);
			document.addUnixScriptForm.countryLocation.value =trim(document.addUnixScriptForm.countryLocation.value);
			document.addUnixScriptForm.deploymentLocation.value =trim(document.addUnixScriptForm.deploymentLocation.value);
			document.addUnixScriptForm.contactPerson.value =trim(document.addUnixScriptForm.contactPerson.value);
			
			document.addUnixScriptForm.AppScreenName.value =trim(document.addUnixScriptForm.AppScreenName.value);
			document.addUnixScriptForm.AppReportName.value =trim(document.addUnixScriptForm.AppReportName.value);
			document.addUnixScriptForm.Purpose.value =trim(document.addUnixScriptForm.Purpose.value);
			document.addUnixScriptForm.DaysTimes.value =trim(document.addUnixScriptForm.DaysTimes.value);
			document.addUnixScriptForm.Dependencies.value =trim(document.addUnixScriptForm.Dependencies.value);
			document.addUnixScriptForm.BusNotification.value =trim(document.addUnixScriptForm.BusNotification.value);
			document.addUnixScriptForm.Audience.value =trim(document.addUnixScriptForm.Audience.value);
			document.addUnixScriptForm.FAQ.value =trim(document.addUnixScriptForm.FAQ.value);
			document.addUnixScriptForm.Notes.value =trim(document.addUnixScriptForm.Notes.value);
			document.addUnixScriptForm.EscProcedure.value =trim(document.addUnixScriptForm.EscProcedure.value);

			
			if(submitForms(document.addUnixScriptForm.shellName, document.addUnixScriptForm.repoLocation, document.addUnixScriptForm.deploymentLocation))
			{			
				document.addUnixScriptForm.act.value="addRow";
				document.addUnixScriptForm.submit();
			}
		}

		function cl(t){
			if (t.defaultValue==t.value) 
				t.value = '';
			}

		function submitForms(obj1, obj2, obj3){
		 	
	    	if(obj1.value.length == 0){
					alert("Please enter Unix Shell Script name.");
					obj1.focus();
					return false;
			}
			
			if(obj2.value.length == 0)
			{
					alert("Please enter SVN location of the shell script.");
					obj2.focus();
					return false;
			}

			if(obj3.value.length == 0){
					alert("Please enter Deployment Location.");
					obj3.focus();
					return false;
			}
			
			if( checkForCRDetails(	document.addUnixScriptForm.AppScreenName, 
									document.addUnixScriptForm.AppReportName, 
									document.addUnixScriptForm.Purpose, 
									document.addUnixScriptForm.DaysTimes, 
									document.addUnixScriptForm.Dependencies, 
									document.addUnixScriptForm.BusNotification,
									document.addUnixScriptForm.Audience, 
									document.addUnixScriptForm.FAQ, 
									document.addUnixScriptForm.Notes, 
									document.addUnixScriptForm.EscProcedure ))
				{
					return true;
				}
			
		//	return true;

		} 	
		
		function checkForCRDetails( obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10){
			
			if(	obj1.value.length == 0 ||
				obj2.value.length == 0 ||
				obj3.value.length == 0 ||
				obj4.value.length == 0 ||
				obj5.value.length == 0 ||
				obj6.value.length == 0 ||
				obj7.value.length == 0 ||
				obj8.value.length == 0 ||
				obj9.value.length == 0 ||
				obj10.value.length == 0)
			{
					alert("Please enter CR details. \n If not applicable then enter N/A");
					obj1.focus();
					return false;
			}
		
			return true;
		}
		

				function submitForms2(obj, obj2, obj3){
		  	
					// alert("obj.value.length"+obj.value);
			
				obj.value = trim(obj.value);
	
				if (obj.value.length == 0 )
				{
					alert("Please enter Object Name.");
					obj.focus();
					return false;
				 }

				 if( obj2.value == 0){
					alert("Please select object type.");
					obj2.focus();
					return false;
				 }

				 if( obj3.value == ''){
					alert("Please enter index for new table.");
					obj3.focus();
					return false;
				}
			
				return true;
				//  document.updateRelease.submit();
				//  document.searchReleaseForm.submit();
	
				//document.displayForm.submit();
		  	
		  				//  document.MainForm.submit();
						//alert("HIIIIIII");
		} 	
		
		function checklengthtovalidate(str, formComponent){
		
			if(str.length > 250) {
				alert("Sorry, You can not enter more then 250 characters");
				formComponent.focus();
				return false;
			}
			else { 
				return true;
			}
		}

		function delRow(num)
		{
			
			document.addRelease.delNumber.value=num;
			document.addRelease.act.value="delRow";
			
			//alert(document.addRelease.delNumber.value);
			document.addRelease.submit();
		}
		function save()
		{			
			document.saveScriptForm.saveFlag.value="save";
			document.saveScriptForm.submit();
		}
		function saveandsend()
		{			
			document.saveScriptForm.saveFlag.value="saveandsend";
			document.saveScriptForm.submit();
		}
	
	</script>
	</head>
	<% 
	ShellUtilities shellUtil = new ShellUtilities(getServletContext());
	
	Vector unixRelVector = new Vector();
	unixRelVector = shellUtil.getUnixRelease(null, 0);
	/*
	if(session.getAttribute("UNIX-REL-VECTOR")!= null){
		unixRelVector = (Vector)session.getAttribute("UNIX-REL-VECTOR");
	}else{
		unixRelVector = shellUtil.getUnixRelease(null, 0);
		if(unixRelVector!=null){
			session.removeAttribute("UNIX-REL-VECTOR");
			//session.setAttribute("UNIX-REL-VECTOR",unixRelVector);
		}
	}
	*/
	
	boolean saveFlag = false;
	String saveMsg = "";
	
	java.text.SimpleDateFormat jsformatter =  new java.text.SimpleDateFormat("dd-MMM-yyyy");
	String currentDate = jsformatter.format(new java.util.Date());
	
	String addButton = request.getParameter("act")==null?"":request.getParameter("act");
	String delButton = request.getParameter("delButton")==null?"":request.getParameter("delButton");
	String saveButton = request.getParameter("saveFlag")==null?"":request.getParameter("saveFlag");
	
	Vector unixScriptVector;
	
	if(addButton.equals("addRow")){
		System.out.println("add button called.......");
		
		unixScriptVector = new Vector();
		UnixScriptBean usBean = new UnixScriptBean();
		
		usBean.setUnixReleaseName(request.getParameter("unixReleaseName")==null?"":request.getParameter("unixReleaseName"));
		usBean.setShellName(request.getParameter("shellName")==null?"":request.getParameter("shellName"));
		usBean.setRepoLocation(request.getParameter("repoLocation")==null?"":request.getParameter("repoLocation"));
		usBean.setCountryLocation(request.getParameter("countryLocation")==null?"":request.getParameter("countryLocation"));
		usBean.setDeploymentLocation(request.getParameter("deploymentLocation")==null?"":request.getParameter("deploymentLocation"));
		String contactPerson = request.getParameter("contactPerson")==null?"":request.getParameter("contactPerson");
		usBean.setContactPerson(contactPerson.toLowerCase());
		usBean.setUserUpdated(userid);
		usBean.setDateUpdated(new Date(currentDate));
		//usBean.setDateUpdated(currentDate);
		usBean.setAppScreenName(request.getParameter("AppScreenName")==null?"":request.getParameter("AppScreenName"));
		usBean.setAppReportName(request.getParameter("AppReportName")==null?"":request.getParameter("AppReportName"));
		usBean.setPurpose(request.getParameter("Purpose")==null?"":request.getParameter("Purpose"));
		usBean.setDaysTimes(request.getParameter("DaysTimes")==null?"":request.getParameter("DaysTimes"));
		usBean.setDependencies(request.getParameter("Dependencies")==null?"":request.getParameter("Dependencies"));
		usBean.setBusNotification(request.getParameter("BusNotification")==null?"":request.getParameter("BusNotification"));
		usBean.setAudience(request.getParameter("Audience")==null?"":request.getParameter("Audience"));
		usBean.setFAQ(request.getParameter("FAQ")==null?"":request.getParameter("FAQ"));
		usBean.setNotes(request.getParameter("Notes")==null?"":request.getParameter("Notes"));
		usBean.setEscProcedure(request.getParameter("EscProcedure")==null?"":request.getParameter("EscProcedure"));
		
			if(session.getAttribute("UNIX-SCRIPT-VECTOR")!=null){
				unixScriptVector = (Vector)session.getAttribute("UNIX-SCRIPT-VECTOR");	
				unixScriptVector.add(usBean);
				session.removeAttribute("UNIX-SCRIPT-VECTOR");
				session.setAttribute("UNIX-SCRIPT-VECTOR", unixScriptVector);
			}else{
				unixScriptVector.add(usBean);
				session.removeAttribute("UNIX-SCRIPT-VECTOR");
				session.setAttribute("UNIX-SCRIPT-VECTOR", unixScriptVector);
			}
			
			
		}
	
	if(delButton.equals("Delete")){
		unixScriptVector = new Vector();
		int delScriptNo = Integer.parseInt(request.getParameter("delScriptNo")==null?"-1":request.getParameter("delScriptNo"));
		unixScriptVector = (Vector)session.getAttribute("UNIX-SCRIPT-VECTOR");
		unixScriptVector.remove(delScriptNo);
		session.removeAttribute("UNIX-SCRIPT-VECTOR");
		session.setAttribute("UNIX-SCRIPT-VECTOR", unixScriptVector);
	}
	
	if(saveButton.equals("save")){
		if(shellUtil.saveUnixScriptDetails((Vector)session.getAttribute("UNIX-SCRIPT-VECTOR"))){
			saveFlag = true;
			saveMsg = "Release Unix Shell Script info saved successfully.";
		}
		session.removeAttribute("UNIX-SCRIPT-VECTOR");
	}
	
	if(saveButton.equals("saveandsend")){
		if(shellUtil.saveUnixScriptDetails((Vector)session.getAttribute("UNIX-SCRIPT-VECTOR")))
		{
			String emailList = request.getParameter("emailList")==null?userid:request.getParameter("emailList");
			shellUtil.sendEmail(emailList, (Vector)session.getAttribute("UNIX-SCRIPT-VECTOR"));
			saveFlag = true;
			saveMsg = "Release Unix Shell Script info saved successfully, Email has been sent for your record.";
		}
		session.removeAttribute("UNIX-SCRIPT-VECTOR");
	}
			
	%>

	<body>
		<table width="100%">
				<tr>
					<td width=100%> <jsp:include page="HeaderNav_ReleaseObject.jsp"/></td>
				</tr>
		</table>
		<a href="mainpage.jsp">Back to Main Page</a>
		<table>
				<tr>
					<td> &nbsp
					</td>
				</tr>
		</table>
		<form name=addUnixScriptForm method="post">
		<input type="hidden" name="act" value="">
		<table cellpadding="0" cellspacing="1" width="70%" style="BORDER:#000000 1px solid" colspan=2 align="center">
				<tr bgcolor="#000077" >
							<td class=smallfonthead width=100% align=left colspan=2><b>Release Unix Script Details</b></td>				
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Unix Shell Release &nbsp&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue >
						<select name=unixReleaseName onchange="alert(this.value);">
							<% 
								UnixReleaseBean urBean = new UnixReleaseBean();
								for(int i=0;i<unixRelVector.size();i++)
								{
									urBean =(UnixReleaseBean)unixRelVector.elementAt(i); 
							%>
									<option value= '<%=	urBean.getUnixReleaseName()%>'>
										<%= urBean.getUnixReleaseName()%> 
									</option>
							<%	}
							%>
						</select>
					</td>
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Unix Shell Script Name&nbsp&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=shellName size="60" value=></td>
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>SVN Repository Location&nbsp&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=repoLocation size="60" value=></td>
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Location &nbsp&nbsp&nbsp</b></td>
					<td class = bodyblue >
						<select name=countryLocation >
							<% 
								Vector shelllocVector = shellUtil.getUnixShellLocations();
								for(int i=0;i<shelllocVector.size();i++)
								{
									DbNameVo dbvo =(DbNameVo)shelllocVector.elementAt(i); 
							%>

									<option value= '<%=	dbvo.getDBName()%>'>
										<%= dbvo.getDBName()%> 
									</option>
				
							<%	}
							%>
							</select>

					</td>		
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Deployment Location &nbsp&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=deploymentLocation size="60"></td>
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align="right"><b>User Updated &nbsp&nbsp&nbsp</b></td>
					<td class = bodyblue><input type=text name=userUpdated size=60 value=<%=userid%> <% out.println("disabled"); %>></td>
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Contact Person's EmailID &nbsp&nbsp&nbsp</b></td>
					<td class = bodyblue ><input type=text name=contactPerson size="60"> 
					<img id="help4" src="/st/images/help.jpg" border="0" width="12" height="15" onMouseover="javascript:showFiles('SelectViewHelp4');" onMouseout="javascript:hideFiles('SelectViewHelp4');">
					        <div id="SelectViewHelp4" style="position:absolute; left:event.x; top:event.y; visibility: hidden; BORDER:#666666 1px solid;background-color: #efefef;width:300px;padding:5px;" onMouseover="javascript:showFiles('SelectViewHelp4');" onMouseout="javascript:hideFiles('SelectViewHelp4');">
							        <br>Please enter the Email-Id of contact person, If he/she is different then Logged in User. 
									<br>Kindly enter only single Email-Id here. You can inform other users by entering more Email-Ids below in Send Email box,  to send email.
					        </div>
					</td>
				</tr>
				<tr bgcolor="#000077" >
					<td class=smallfonthead width=100% align=left colspan=2><b>Unix Script - CR Related Details</b></td>				
				</tr>
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>App. Screen / Functionality Name&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=AppScreenName size="60" value='' onfocus="cl(this);" onBlur='return checklengthtovalidate(document.addUnixScriptForm.AppScreenName.value, document.addUnixScriptForm.AppScreenName)'> </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>App. Report&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=AppReportName size="60" value='' onfocus="cl(this);" onBlur='return checklengthtovalidate(document.addUnixScriptForm.AppReportName.value, document.addUnixScriptForm.AppReportName)'> </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Purpose of Functionality&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=Purpose size="60" value='' onfocus="cl(this);" onBlur='return checklengthtovalidate(document.addUnixScriptForm.Purpose.value, document.addUnixScriptForm.Purpose)' > </td>
				</tr>
				
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Days/Times Of Operation&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text  name=DaysTimes size="60" value='' onfocus="cl(this);"  onBlur='return checklengthtovalidate(document.addUnixScriptForm.DaysTimes.value, document.addUnixScriptForm.DaysTimes)' > </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Dependencies&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=Dependencies size="60" value='' onfocus="cl(this);" onBlur='return checklengthtovalidate(document.addUnixScriptForm.Dependencies.value, document.addUnixScriptForm.Dependencies)' > </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Business Notifications&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=BusNotification size="60" value='' onfocus="cl(this);"  onBlur='return checklengthtovalidate(document.addUnixScriptForm.BusNotification.value, document.addUnixScriptForm.BusNotification)' > </td>
				</tr>
				
				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Audience&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=Audience size="60" value=''onfocus="cl(this);" onBlur='return checklengthtovalidate(document.addUnixScriptForm.Audience.value, document.addUnixScriptForm.Audience)' > </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>FAQ&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=FAQ size="60" value='' onBlur='return checklengthtovalidate(document.addUnixScriptForm.FAQ.value, document.addUnixScriptForm.FAQ)' > </td>
				</tr>


				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Notes&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=Notes size="60" value='' onBlur='return checklengthtovalidate(document.addUnixScriptForm.Notes.value, document.addUnixScriptForm.Notes)' > </td>
				</tr>

				<tr bgcolor=#EFEFEF>
					<td class = bodyblue align=right><b>Escalation Procedure&nbsp&nbsp</b><font  color="#FF6600"> * </font></td>
					<td class = bodyblue ><input type=text name=EscProcedure size="60" value=''onfocus="cl(this);"  onBlur='return checklengthtovalidate(document.addUnixScriptForm.EscProcedure.value, document.addUnixScriptForm.EscProcedure)' > </td>
				</tr>
				
				<tr bgcolor=#EFEFEF>
				<td></td>
				<td><input type=button class=whitebutton name=addButton value=Add  onclick='return addRow()'>
						&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<font  color="#FF6600"> * - Mandatory Field</font>
				</td>
				</tr>
			</table>
		  </form>	
			
			<% 
				Vector dispUnixScriptVector = new Vector();
				dispUnixScriptVector =(Vector) session.getAttribute("UNIX-SCRIPT-VECTOR");
				if( dispUnixScriptVector != null && dispUnixScriptVector.size() >0)
				{

			%>
					<table cellpadding="0" cellspacing="1"  style="BORDER:#000000 1px solid" colspan=8 width=100%>
						<tr bgcolor="#000077" >
							<td class=smallfonthead width=100% colspan=8><b>New Added Unix Shell Scripts</b></td>				
						</tr>				
						<tr bgcolor="#000077" >
							<td class=smallfonthead width=5% colspan=1><b> # </b></td>
							<td class=smallfonthead width=15% colspan=1><b>Script Name </b></td>
							<td class=smallfonthead width=25% colspan=1><b>SVN Repo Location </b></td>
							<td class=smallfonthead width=5% colspan=1><b>Location</b></td>
							<td class=smallfonthead width=20% colspan=1><b>Deployment Location </b></td>
							<td class=smallfonthead width=10% colspan=1><b>User Updated </b></td>
							<td class=smallfonthead width=10% colspan=1><b>Date Updated </b></td>
							<td class=smallfonthead width=10% colspan=1><b>Action</b></td>
						</tr>

					

					<%
						HashSet contactList = new HashSet();
	
						for(int i=0 ;i<dispUnixScriptVector.size();i++)
						{
							UnixScriptBean usBean = (UnixScriptBean)dispUnixScriptVector.elementAt(i);
					%>
						<form name=dispScriptForm method="post">
						<input type="hidden" name="delScriptNo" value='<%= i %>'>
							<tr  bgcolor=#EFEFEF>
								<td class=bodyblue > <%= i+1  %> </td>	
								<td class=bodyblue > <%= usBean.getShellName()  %> </td>
								<td class=bodyblue > <%= usBean.getRepoLocation()  %> </td>
								<td class=bodyblue > <%= usBean.getCountryLocation()  %> </td>
								<td class=bodyblue > <%= usBean.getDeploymentLocation()  %> </td>
								<td class=bodyblue > <%= usBean.getUserUpdated()  %> </td>
								<td class=bodyblue align='center'> <%= currentDate  %> </td>
								<td class=bodyblue align='center'><input type=submit class=whitebutton name=delButton value='Delete'></td>
							</tr>
						</form>	
					<%		contactList.add(usBean.getContactPerson());		
					
						}
				
					%>
			</table>
			
			<table>
					<tr><td>&nbsp</td></tr>
			</table>
			<form name="saveScriptForm" method="post">
			<input type="hidden" name="saveFlag" value="">
			<table cellpadding="0" cellspacing="1" width="100%" style="BORDER:#000000 1px solid">
				<tr bgcolor=#EFEFEF >
					<td  class = bodyblue align=center class=bodyblue width="30%">
						<input type=button class=whitebutton  value=Save onClick="save()">
						<input type=button class=whitebutton  value="Save&Send"  onClick="saveandsend()">
						<img id="help3" src="/st/images/help.jpg" border="0" width="12" height="15" onMouseover="javascript:showFiles('SelectViewHelp3');" onMouseout="javascript:hideFiles('SelectViewHelp3');">
						<div id="SelectViewHelp3" style="position:absolute; left:event.x; top:event.y; visibility: hidden; BORDER:#666666 1px solid;background-color: #efefef;width:300px;padding:5px;" onMouseover="javascript:showFiles('SelectViewHelp3');" onMouseout="javascript:hideFiles('SelectViewHelp3');">
							<br>By clicking on 'Save' you can save the Script details which you have entered. and by clicking on 'Save&Send' you can save the details and you will get the email for the Details which you have entered over here for your record.  
						</div>
					</td>
					<td class=bodyblue width="30%"><b>Enter other email id to send the email [optional]</b>
						<img id="help2" src="/st/images/help.jpg" border="0" width="12" height="15" onMouseover="javascript:showFiles('SelectViewHelp2');" onMouseout="javascript:hideFiles('SelectViewHelp2');">
					    <div id="SelectViewHelp2" style="position:absolute; left:event.x; top:event.y; visibility: hidden; BORDER:#666666 1px solid;background-color: #efefef;width:300px;padding:5px;" onMouseover="javascript:showFiles('SelectViewHelp2');" onMouseout="javascript:hideFiles('SelectViewHelp2');">
					        <br>You can inform other users also by email for added new objects, by entering email ids here. also can enter more then one email ids by comma(,) separated.
					    </div>
					</td>
					<%
					String contactPersonString = "";
					contactPersonString = userid;
					Vector contactListVector = new Vector(contactList);
					
					for(int i=0; i< contactListVector.size();i++){
						if(!(((String)contactListVector.elementAt(i)).equals(""))){
							contactPersonString = contactPersonString + ","+(String)contactListVector.elementAt(i);	
						}
					}
					
					
					%>
					<td class=bodyblue width="40%"><input type=text name=emailList size="40" value='<%= contactPersonString %>'>
					</td>
				</tr>
			</table>
			</form>
			<% } %>
	</body>
</html>





<% }
}
catch(Exception e) {
				e.printStackTrace();
		}

		%>
